package com.fetch.ui;

import javax.swing.JLabel;

/**
 * 状态栏
 */
public class Status extends JLabel {
	private static final long serialVersionUID = 1L;
	
	private String name;
	private int totalPage = 0; 
	private int completePage = 0;
	private int total = 0; 
	private int complete = 0;
	
	public Status(){}
	
	public Status(String name){
		this.name = name;
		this.setText(null);
	}
	
	public void reset(){
		total = 0;
		complete = 0;
	}
	
	public void setText(String text){
		super.setText(this.name + " => 当前页进度: " + this.complete + " / " +this.total + "   页码进度: " + this.completePage+ " / " +this.totalPage);
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getTotalPage() {
		return totalPage;
	}

	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
		this.setText(null);
	}

	public int getCompletePage() {
		return completePage;
	}

	public void setCompletePage(int completePage) {
		this.completePage = completePage;
		this.setText(null);
	}
	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
		this.setText(null);
	}

	public int getComplete() {
		return complete;
	}

	public void setComplete(int complete) {
		this.complete = complete;
		this.setText(null);
	}

	public void completePageIncr(){
		setCompletePage(this.getCompletePage()+1);
	}
}
